-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat) Load pure CSS files in the styleguide via css-loader
#777
Conversation
Size Change: -921 kB (-25%) 🎉 Total Size: 2.79 MB
ℹ️ View Unchanged
|
css-loader
Have you tested this with the updated React Spectrum libraries? |
So, I think this also needs to be applied to the framework. |
use: [{ loader: MiniCssExtractPlugin.loader }, "css-loader"], | ||
}, | ||
{ | ||
test: /\.s[ac]ss$/i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the "postcss-loader" used for sass/scss, and is this needed for pure css?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It runs postcss, a CSS post-processor on the CSS. I suppose it wouldn't hurt to put in here. (we mostly use it for this feature).
Closing in favour of #778 |
Requirements
For changes to apps
If applicable
Summary
This PR attempts to fix an issue where the latest version of the openmrs tooling fails to build frontend assets as expected. More specifically, running
npx --legacy-peer-deps openmrs@next build --build-config /spa-build-config.json --target /app
(or its equivalents) yields the following error:https://openmrs.slack.com/files/UJ8TY7J05/F05UG139EHM/cleanshot_2023-10-03_at_12___.10.08_2x.png?origin_team=T03U4PGDY&origin_channel=CHP5QAE5R
Digging deeper, this error stems from the tooling failing to load CSS provided by the React Spectrum library. As explained in the linked thread, the styleguide uses a custom webpack config which doesn't leverage either
style-loader
orcss-loader
for loading CSS modules. This PR adds a rule to the styleguide's webpack config that enables loading pure CSS files (such as the ones coming from external libraries) usingcss-loader
.Screenshots
Related Issue
Other